package cn.cdeden.knowledge.mapper;

import cn.cdeden.common.mybatis.core.mapper.BaseMapperPlus;
import cn.cdeden.knowledge.domain.EnterpriseFilesTree;
import cn.cdeden.knowledge.domain.dto.EnterpriseFilesTreeDto;
import cn.cdeden.knowledge.domain.dto.EnterpriseFilesTreeQueryParam;
import cn.cdeden.knowledge.domain.dto.FilesTree;
import cn.cdeden.knowledge.domain.dto.SearchFilesInfoDto;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface EnterpriseFilesTreeMapper extends BaseMapperPlus<EnterpriseFilesTree,EnterpriseFilesTree> {

    List<EnterpriseFilesTree> selectSuperiorAll(String id);

    List<EnterpriseFilesTreeDto> selectEnterpriseList(@Param("ew") Wrapper<EnterpriseFilesTree> wrapper, @Param("query") EnterpriseFilesTreeQueryParam query);

    IPage<EnterpriseFilesTreeDto> selectEnterprisePage(@Param("ew") Wrapper<EnterpriseFilesTree> wrapper, @Param("query") EnterpriseFilesTreeQueryParam query, IPage<EnterpriseFilesTreeDto> page);

    IPage<FilesTree> searchTree(@Param("query") SearchFilesInfoDto infoDto, IPage page);

    List<EnterpriseFilesTree> nameRecheckingVerifyData(String parentId);


    Integer selectByIdTreePageInfoPerm(@Param("userId") String userId ,
                                       @Param("deptIds") List<Long> deptIds,
                                       @Param("roleIds") List<Long> roleIds,
                                       @Param("jobIds") List<Long> jobIds,
                                       @Param("treeId") String treeId,
                                       @Param("parentId") String parentId,
                                       @Param("size") Integer size,
                                       @Param("sort") List<String> sort);



    Integer selectByIdTreePageInfoNoPerm(@Param("userId") String userId ,
                                         @Param("treeId") String treeId,
                                         @Param("parentId") String parentId,
                                         @Param("size") Integer size,
                                         @Param("sort") List<String> sort);



}
